﻿using System;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace PowerMonitor
{
    public partial class baseDockForm : DockContent
    {
        public baseDockForm()
        {
            InitializeComponent();
        }

        private void mnuDocClose_Click(object sender, EventArgs e)
        {
            if (this.HideOnClose)
            {
                this.Hide();
            }
            else
            {
                this.Close();      
            }
        }

        private void mnuDocCloseOther_Click(object sender, EventArgs e)
        {
            //AppMain.fMain.CloseBut(this);
        }

        private void mnuDocCloseAll_Click(object sender, EventArgs e)
        {
            //AppMain.fMain.CloseAll();
        }
        const int WM_KEYDOWN = 0x0112;
        protected override void WndProc(ref Message m)
        {
            // 
            // Console.WriteLine(string.Format("MSG:{0},LPARAM:{1},WPARAM:{2}\n",m.Msg,m.LParam,m.WParam));
            if (m.Msg == WM_KEYDOWN)
            {
                if (m.LParam == (IntPtr)115 && m.WParam == (IntPtr)61536) // 屏蔽Ctrl + F4(关闭窗口)
                {
                    return;
                }
            }
            base.WndProc(ref m);
        }
    }
}
